#ifndef LIGHTS_H
#define LIGHTS_H

#include "Entity.h"

class ENGINE_API Light
{
public:
   Light();
   ~Light() {}

   bool setLight(Renderer* renderer);

   void setColor(float R, float G, float B, float diffuse);

   void setRange(float range);

protected:
   D3DLIGHT9 m_light;
   DWORD m_color;

};

/////////////////////////////////////////////////////////////////////
///////////////////////    Types of lights    ///////////////////////
/////////////////////////////////////////////////////////////////////
class ENGINE_API DirectionalLight : public Light
{
public:
   DirectionalLight(const Vector3 &direction)
   {
      m_light.Type = D3DLIGHT_DIRECTIONAL;
      m_light.Direction = direction;
   }
};
//---------------------------------------------------------------------------------------------//
class ENGINE_API PointLight : public Light
{
public:
   PointLight(const Vector3 &position)
   {
      m_light.Type = D3DLIGHT_POINT;
      m_light.Position = position;
   }
};
//---------------------------------------------------------------------------------------------//
class ENGINE_API SpotLight : public Light
{
public:
   SpotLight(const Vector3 &direction, const Vector3 &position)
   {
      m_light.Type = D3DLIGHT_SPOT;
      m_light.Direction = direction;
      m_light.Position = position;

      m_light.Range = 1.0f;
      m_light.Theta = 0.5f;
      m_light.Phi = 1.0f;
      m_light.Falloff = 1.0f;
      m_light.Attenuation0 = 1.0f;
   }
};

#endif//LIGHTS_H

